<!DOCTYPE HTML>
<html>
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
        <meta name="format-detection" content="telephone=no" />
        <title>搜索</title>
        <link rel="stylesheet" type="text/css" href="../css/aui.css" />
        <link rel="stylesheet" href="../css/mui.min.css">
        <link rel="stylesheet" type="text/css" href="../css/aui-slide.css" />
        <style>
            body{
                font-size: 14px;
            }
            header{
                background: #fff;
            }
            .aui-searchbar{
                -webkit-box-align:start;
                -webkit-box-pack:start;
                line-height: 34px;
                height: 34px;
            }
            .aui-tab-nav li{
                position: relative;
            }
            .aui-tab-nav li.active {
                color: #ff3333;
                border:none;
                
            }
            .aui-tab-nav li.active:before{
                content:"";
                bottom: 0;
                position: absolute;
                height: 2px;
                background: #ff3333;
                width: 40%;
                left: 30%;
            }
            .serch{
                font-size: 12px;
            }
            .searchTitle{
                padding:12px 0;
                color: #9c9c9c;
            }
            .aui-iconfont {
                margin-right:5px;
            }
            .searchList{
                overflow: hidden;
            }
            .aui-content-padded{
                margin-bottom: 0;
            }
            .searchList li:nth-of-type(3n){
                margin-right:0%;
            }
            .searchList li {
                margin-right:2%;
                text-align: center;
                margin-bottom: 10px;
                width: 32%;
                float: left;
            }
            .searchList li span{
                padding:8px 0;
                display: block;
                border:1px solid #d9d9d9;
                background: #fff;
            }
            .aui-iconfont{
                font-size: 14px;
            }
            .aui-list-view{
                margin-bottom: 0;
            }
            .aui-content .aui-list-view:last-of-type:after{
                border:none;
            }
            .noHistory{
                width: 100%;
                padding:50px;
                background: #fff;
                color: #9c9c9c;
            }
            .mui-table-view-cell:after{
                left: 0;
            }
            input[type=search]{
                border-radius: 0;
            }
            .aui-searchbar-wrap{
                background: #FFF;
            }
            .aui-text-info{
                color: #ff3333 !important;
            }
        </style>
    </head>
    <body>
        <header>
            <div class="aui-searchbar-wrap demo" id="search">
                <div class="aui-searchbar aui-border-radius" tapmode onclick="">
                    <div class="aui-searchbar-input">
                        <form action="javascript:search();">
                        <input type="search" placeholder="请输入搜索内容" id="search-input">
                        </form>
                    </div>
                    <i class="aui-iconfont aui-icon-roundclosefill" tapmode onclick="clearInput()"></i>
                </div>
                <div class="aui-searchbar-cancel aui-text-info" tapmode onclick="closeWin()">取消</div>
            </div>
        </header>
        <div class="containt">
            <div class="serch aui-content-padded">
                <div class="searchTitle"><span>大家都在搜</span><span class="aui-pull-right"><i class="aui-iconfont aui-icon-refresh"></i>换一批</span></div>
                <div class="searchList">
                    <ul>
                        <li>
                            <span>童装面料</span>
                        </li>
                        <li>
                            <span>纺面料</span>
                        </li>
                        <li>
                            <span>女装面料</span>
                        </li>
                        <li>
                            <span>童装面料</span>
                        </li>
                    </ul>
                </div>
                <div class="searchTitle"><span>搜索历史</span></div>
            </div>
            <div class="aui-content ">
                <ul class=" mui-table-view">
                    <li class="mui-table-view-cell">
                        <div class="mui-slider-right mui-disabled">
                            <a class="mui-btn mui-btn-red">删除</a>
                        </div>
                        <div class="mui-slider-handle">
                            纱布
                        </div>
                    </li>
                    <li class="mui-table-view-cell">
                        <div class="mui-slider-right mui-disabled">
                            <a class="mui-btn mui-btn-red">删除</a>
                        </div>
                        <div class="mui-slider-handle">
                            纺织品锦纶丝光纱
                        </div>
                    </li>
                    <li class="mui-table-view-cell">
                        <div class="mui-slider-right mui-disabled">
                            <a class="mui-btn mui-btn-red">删除</a>
                        </div>
                        <div class="mui-slider-handle">
                            广州中大女纱纺织品有限公司
                        </div>
                    </li>
                </ul>
                <ul class="aui-list-view">
                    <li class="aui-list-view-cell aui-text-center">
                        清空搜索历史
                    </li>
                </ul>
            </div>
            <div class="noHistory aui-text-center">
                <i class="aui-iconfont aui-icon-time"></i>暂无搜索历史
            </div>
        </div>
    </body>
    <script type="text/javascript" src="../script/api.js" ></script>
    <script type="text/javascript" src="../script/doT.min.js"></script>
    <script type="text/javascript" src="../script/echo.js"></script>
    <script type="text/javascript" src="../script/common.js"></script>
    <script type="text/javascript" src="../script/myInfo.js"></script>
    <script type="text/javascript" src="../script/jquery-1.11.3.js"></script>
    <script type="text/javascript" src="../script/mui.min.js"></script>    
    <script type="text/javascript">
        mui.init();
        doSearch();
        apiready = function(){
            api.parseTapmode();
        }
        function doSearch(){
            $api.addCls($api.dom(".aui-searchbar-wrap"),"focus");
            $api.dom('.aui-searchbar-input input').focus();
        }
        // function cancelSearch(){
        //     $api.removeCls($api.dom(".aui-searchbar-wrap.focus"),"focus");
        //     $api.val($api.byId("search-input"),'');
        //     $api.dom('.aui-searchbar-input input').blur();
        // }
        function clearInput(){
            $api.val($api.byId("search-input"),'');
        }
        function search(){
            var content = $api.val($api.byId("search-input"));
            if(content){
                // api.alert({
                //     title: '搜索提示',
                //     msg: '您输入的内容为：'+content
                // });

                //传参数到proList页面刷选
                api.openWin({
                    name: 'searchList',
                    url: 'proList_win.html',
                    pageParam: {
                        content: content
                    }
                });
            }else{
                api.alert({
                    title: '搜索提示',
                    msg: '您没有输入任何内容'
                });
            }
        }
        function changeType(obj){
            $(obj).parent().find("li").removeClass("active");
            $(obj).addClass("active");
        }
    </script>
</html>